<?php
namespace Nawa\Survey\Question;
/**
 * Survey Anwser
 * 
 * An answer is define with a language,a type...
 * 
 * @author Xavier VILAIN
 * @package Nawa\Survey\Question
 * @license #license-nawa-survey#
 * 
 * @property 	int 	$questionid	Question Id
 * @property 	int 	$answerid	Anwser Id
 * @property	string	$language	Default Language
 * @property	string	$label		
 * @property	int		$type		Type of Anwser (Input,Checkbox, Radio...)
 * (@see Nawa\Survey\Question\Answer\Type for futher information)
 * @property	string	$params		Additionnal Params if needed
 * 
 */
class Answer extends \Fox\Object {
	
	/**
	 * Link to question 
	 * @var sring
	 */
	const LINK_QUESTION = 'question';
	
	/**
	 * Link to translation 
	 * @var sring
	 */
	const LINK_I18N = 'i18n';	
}
\Fox\Dao::infos(Answer::className(),
new \Fox\Object\Info('survey_section_question_answers', \Fox\Databases::DB_APP))
	->addAutoIncrementField('answerid');

// Link to i18n
\Fox\Object\Links::add(\Fox\Dao::link(Answer\I18n::className(),Answer\I18n::LINK_ANSWER)
->to(Answer::className(), Answer::LINK_I18N)
->on('questionid','answerid')
->versionFrom());